package com.lianxian.xindong.me.mvp.model;

import android.app.Application;

import com.google.gson.Gson;
import com.hxb.library.integration.IRepositoryManager;
import com.hxb.library.mvp.BaseModel;

import com.hxb.library.di.scope.FragmentScope;

import javax.inject.Inject;

import com.lianxian.xindong.commonres.entity.ResultBaseBean;
import com.lianxian.xindong.commonres.entity.ResultBaseListBean;
import com.lianxian.xindong.me.mvp.contract.FriendCirclesContract;
import com.lianxian.xindong.me.mvp.model.api.service.MeService;
import com.lianxian.xindong.me.mvp.model.entity.CircleBean;

import io.reactivex.Observable;


/**
 * @作者：hexingbo
 * @时间：07/07/2023
 * @描述：
 */
@FragmentScope
public class FriendCirclesModel extends BaseModel implements FriendCirclesContract.Model {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    @Inject
    public FriendCirclesModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }

    @Override
    public Observable<ResultBaseBean<ResultBaseListBean<CircleBean>>> getNetForData(int pageCurrent, int pageSize) {
        return mRepositoryManager.obtainRetrofitService(MeService.class).getCircleData(pageCurrent, pageSize);
    }

}